Some types of implantable medical devices, such as cardiac pacemakers or implantable cardioverter defibrillators, provide therapeutic electrical stimulation to a heart of a patient via electrodes of one or more implantable leads. The therapeutic electrical stimulation may be delivered to the heart in the form of pulses or shocks for pacing, cardioversion or defibrillation. In some cases, an implantable medical device may sense intrinsic depolarizations of the heart, and control the delivery of therapeutic stimulation to the heart based on the sensing.